package com.wl.lib.utils

import android.annotation.SuppressLint
import androidx.annotation.ColorInt
import androidx.annotation.PluralsRes


// Created by wangliang on 2024/4/28.
object ResUtils {

    fun getString(id: Int) = ApplicationHelper.getInstance().resources.getString(id)

    fun getString(id: Int, vararg formatArgs: Any) =
        ApplicationHelper.getInstance().resources.getString(id, formatArgs)

    fun getQuantityString(@PluralsRes id: Int, quantity: Int) =
        ApplicationHelper.getInstance().resources.getQuantityString(id, quantity)

    fun getQuantityString(@PluralsRes id: Int, quantity: Int, vararg formatArgs: Any) =
        ApplicationHelper.getInstance().resources.getQuantityString(id, quantity, formatArgs)

    @ColorInt
    fun getColor(id: Int) = ApplicationHelper.getInstance().resources.getColor(id)

    @SuppressLint("UseCompatLoadingForDrawables")
    fun getDrawable(id: Int) = ApplicationHelper.getInstance().resources.getDrawable(id)
}